package  
{
	import flash.display.MovieClip;
	import flash.display.Sprite;
	import flash.geom.ColorTransform;
	
	/**
	 * ...
	 * @author 
	 */
	public class Item extends MovieClip {
		
		public static const RED		:uint = 1;
		public static const GREEN	:uint = 2;
		public static const BLUE	:uint = 3;
		public static const YELLOW	:uint = 4;
		public static const PINK	:uint = 5;
		
		public var row		:int;
		public var col		:int;
		public var value	:Boolean = false;
		public var color	:int = -1;
		public var small	:Boolean = false;
		
		public function Item() {
			mouseChildren = false;
			buttonMode = true;
			mcActive.visible = false;
		}	
		
		public function setData(_row:int, _col:int, _value:Boolean, _color:int):void 
		{
			this.row = _row;
			this.col = _col;
			this.value = _value;
			this.color = _color;
			this.small = false;
			this.mcSphere.visible = this.value;
			
			if (this.color != 0 && this.color <= 5) {
				this.mcSphere.gotoAndStop(this.color);
			}
		}
		
		public function show():void {
			this.small = false;
			this.gotoAndPlay('zoomIn');
			this.mcSphere.visible = true;
		}
		
		public function hide():void {
			this.gotoAndStop(1);
			
			this.value = false;
			this.mcSphere.visible = false;
		}
		
		public function selected():void 
		{
			this.gotoAndPlay('selected');
			this.mcSphere.visible = true;
		}
		
		public function unselected():void {
			this.gotoAndStop(1);			
		}
		
		public function prepare():void
		{
			small = true;
			value = true;
			this.mcSphere.visible = true;
			
			this.gotoAndStop("small");
		}
		
	}
}